package com.wiscamp.ninechapters.tags.application.assemblers;

import com.wiscamp.ninechapters.tags.application.dto.command.CreateCourseCommand;
import com.wiscamp.ninechapters.tags.application.dto.command.CreateCourseOutlineCommand;
import com.wiscamp.ninechapters.tags.application.dto.command.UpdateCourseCommand;
import com.wiscamp.ninechapters.tags.application.dto.command.UpdateCourseOutlineCommand;
import com.wiscamp.ninechapters.tags.application.dto.vo.CourseOutlineVO;
import com.wiscamp.ninechapters.tags.application.dto.vo.CourseVO;
import com.wiscamp.ninechapters.tags.domain.models.Course;
import com.wiscamp.ninechapters.tags.domain.models.CourseOutline;
import jakarta.validation.constraints.NotNull;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface CourseAssembler {
    CourseAssembler Instance = Mappers.getMapper(CourseAssembler.class);

    // region course
    CourseVO toCourseVO(@NotNull Course entity);

    Course fromCreateCommand(@NotNull CreateCourseCommand command);

    Course fromUpdateCommand(@NotNull UpdateCourseCommand command);
    // endregion

    // outline
    CourseOutlineVO toCourseOutlineVO(@NotNull CourseOutline entity);

    CourseOutline fromCreateCommand(@NotNull CreateCourseOutlineCommand command);

    CourseOutline fromUpdateCommand(@NotNull UpdateCourseOutlineCommand command);
    // endregion
}
